package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * StorageGridUnlockRecord generated by hbm2java
 */
@Entity
@Table(name = "storage_grid_unlock_record", catalog = "cabinet")
public class StorageGridUnlockRecord implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer storageGridUnlockId;
	private User user;
	private int storageGridId;
	private String unlockDesc;
	private Date insertTime;
	private Integer lockerId;

	public StorageGridUnlockRecord() {
	}

	public StorageGridUnlockRecord(int storageGridId, String unlockDesc,
			Date insertTime) {
		this.storageGridId = storageGridId;
		this.unlockDesc = unlockDesc;
		this.insertTime = insertTime;
	}

	public StorageGridUnlockRecord(User user, int storageGridId,
			String unlockDesc, Date insertTime, Integer lockerId) {
		this.user = user;
		this.storageGridId = storageGridId;
		this.unlockDesc = unlockDesc;
		this.insertTime = insertTime;
		this.lockerId = lockerId;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "storage_grid_unlock_id", unique = true, nullable = false)
	public Integer getStorageGridUnlockId() {
		return this.storageGridUnlockId;
	}

	public void setStorageGridUnlockId(Integer storageGridUnlockId) {
		this.storageGridUnlockId = storageGridUnlockId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "insert_user")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "storage_grid_id", nullable = false)
	public int getStorageGridId() {
		return this.storageGridId;
	}

	public void setStorageGridId(int storageGridId) {
		this.storageGridId = storageGridId;
	}

	@Column(name = "unlock_desc", nullable = false, length = 256)
	@NotNull
	@Length(max = 256)
	public String getUnlockDesc() {
		return this.unlockDesc;
	}

	public void setUnlockDesc(String unlockDesc) {
		this.unlockDesc = unlockDesc;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", nullable = false, length = 19)
	@NotNull
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "locker_id")
	public Integer getLockerId() {
		return this.lockerId;
	}

	public void setLockerId(Integer lockerId) {
		this.lockerId = lockerId;
	}

}
